package com.wicket.okroperation.biz.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.wicket.okroperation.biz.service.dto.req.*;
import com.wicket.okroperation.biz.service.dto.res.*;
import com.wicket.okroperation.common.exception.BizException;
import com.wicket.okroperation.common.util.CommonFunctionHelper;
import com.wicket.okroperation.common.util.RedisUtil;
import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.wicket.okrcomponent.integration.dto.QuerySchemeOpenRecordListComRespDto;
import com.wicket.okrcomponent.integration.dto.QuerySchemeOpenRecordListComReqDto;
import com.wicket.okrcomponent.integration.dto.SchemeOpenRecordDto;
import java.util.Collections;
import com.wicket.okroperation.common.exception.Assert;
import com.wicket.okrcomponent.integration.FwCompSchemeOpenRecordClient;
import com.wicket.okroperation.base.service.MOmsSoftwareAuthorizationService;
import com.wicket.okroperation.dal.po.mbg.OmsSoftwareAuthorization;
import com.wicket.okroperation.base.service.dto.req.QuerySoftwareAuthorizationListReq;
import com.wicket.okroperation.base.service.dto.common.SoftwareAuthorizationDto;
import java.util.ArrayList;
import com.wicket.okrcomponent.integration.dto.QuerySchemeAuthInfoDetailComRespDto;
import com.wicket.okrcomponent.integration.dto.QuerySchemeAuthInfoDetailComReqDto;
import com.wicket.okroperation.biz.service.nb.NbSecurity;
import com.wicket.okroperation.base.service.dto.req.QuerySoftwareAuthorizationDetailReq;
import cn.hutool.core.collection.CollectionUtil;
import com.wicket.okroperation.base.service.dto.req.ImplementSoftwareAuthorizationLoopStartReq;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@Service
public class SecurityServiceImpl
  implements com.wicket.okroperation.biz.service.SecurityService {

  @Resource
  private RedisUtil redisUtil;
@Resource
 private MOmsSoftwareAuthorizationService mOmsSoftwareAuthorizationService;
//@Resource
 //private undefinedService undefinedService;
@Resource
  private FwCompSchemeOpenRecordClient fwCompSchemeOpenRecordClient;
//@Resource
 //private MOmsSchemeOpenRecordService mOmsSchemeOpenRecordService;
@Resource
  private NbSecurity nbSecurity;
/**
   * D6执行刷软件授权证书[6705]
   * gen by moon at 5/28/2023, 12:47:47 AM
   */
  @Trace(operationName = "D6执行刷软件授权证书")
  @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Transactional(rollbackFor=Exception.class)
  @Override
  public ImplementBrushSoftwareAuthorizationRespDto implementBrushSoftwareAuthorization(ImplementBrushSoftwareAuthorizationReqDto reqDto){
    
      
      //virtualUsage D2-3查询方案开通记录列表(公共)  41953
      QuerySchemeOpenRecordListComRespDto querySchemeOpenRecordListComRespDto = null;
    QuerySchemeOpenRecordListComReqDto querySchemeOpenRecordListComReqDto=new QuerySchemeOpenRecordListComReqDto();
  if(reqDto!=null){
      querySchemeOpenRecordListComReqDto.setTenantSpaceId(reqDto.getTenantSpaceId());//SimpleFieldAssign//sourceId:942582_1_41953
    }
  
    /*D2-3查询方案开通记录列表(公共)[3165]   */
    Assert.isNull(querySchemeOpenRecordListComReqDto.getTenantSpaceId(),"D6执行刷软件授权证书-D2-3查询方案开通记录列表(公共)-租户空间ID不能为空",false);
      querySchemeOpenRecordListComRespDto = fwCompSchemeOpenRecordClient.querySchemeOpenRecordListCom(querySchemeOpenRecordListComReqDto).getData()/*vcase invoke 跨dubbo调用;*/;
      
      
      
//virtualUsage M6执行软件证书【循环开始】  41954
      //ModelCode: circulationCollections
        for (SchemeOpenRecordDto circulationCollectionsRes: querySchemeOpenRecordListComRespDto.getSchemeOpenRecordList()){ 
      
//virtualUsage 6-1-01查询软件授权证书详情  41955
      OmsSoftwareAuthorization omsSoftwareAuthorization = null;
    QuerySoftwareAuthorizationDetailReq querySoftwareAuthorizationDetailReq=new QuerySoftwareAuthorizationDetailReq();
  querySoftwareAuthorizationDetailReq.setIsArchive("FALSE");//sourceId:952528_1_41955
if(circulationCollectionsRes!=null){
      querySoftwareAuthorizationDetailReq.setSchOpenRecordId(circulationCollectionsRes.getSchOpenRecordId());//SimpleFieldAssign//sourceId:952525_1_41955
    }
  
    /*6-1-01查询软件授权证书详情[6605]   */
    Assert.isNull(querySoftwareAuthorizationDetailReq.getSchOpenRecordId(),"D6执行刷软件授权证书-6-1-01查询软件授权证书详情-开通钥匙ID不能为空",false);
Assert.isNull(querySoftwareAuthorizationDetailReq.getIsArchive(),"D6执行刷软件授权证书-6-1-01查询软件授权证书详情-是否存档不能为空",false);
      omsSoftwareAuthorization = mOmsSoftwareAuthorizationService.querySoftwareAuthorizationDetail(querySoftwareAuthorizationDetailReq)/*vcase invoke 本地 method 方法调用;*/;
      
      
      
if((omsSoftwareAuthorization == null )) {
        //if(6-1-01查询软件授权证书详情.出参 值等于空 )  41956
        
AddSoftwareAuthorizationComRespDto addSoftwareAuthorizationComRespDto = null;
    AddSoftwareAuthorizationComReqDto addSoftwareAuthorizationComReqDto=new AddSoftwareAuthorizationComReqDto();
  if(circulationCollectionsRes!=null){
      addSoftwareAuthorizationComReqDto.setSchOpenRecordId(circulationCollectionsRes.getSchOpenRecordId());//SimpleFieldAssign//sourceId:945595_1_41957
addSoftwareAuthorizationComReqDto.setSubjectLifeCycle(circulationCollectionsRes.getSubjectLifeCycle());//SimpleFieldAssign//sourceId:945596_1_41957
    }
if(reqDto!=null){
      addSoftwareAuthorizationComReqDto.setTenantSpaceId(reqDto.getTenantSpaceId());//SimpleFieldAssign//sourceId:987958_1_41957
    }

    /*D6新增软件授权证书(公共)[6609]   */
    Assert.isNull(addSoftwareAuthorizationComReqDto.getSchOpenRecordId(),"D6执行刷软件授权证书-D6新增软件授权证书(公共)-开通钥匙ID不能为空",false);
Assert.isNull(addSoftwareAuthorizationComReqDto.getSubjectLifeCycle(),"D6执行刷软件授权证书-D6新增软件授权证书(公共)-主体生命周期不能为空",false);
      addSoftwareAuthorizationComRespDto = addSoftwareAuthorizationCom(addSoftwareAuthorizationComReqDto)/*vcase invoke 同服务,同domain*/;
      
      
      
      }
//virtualUsage M6执行平台运营【循环结束】  41958
      //ModelCode: circulationEnd
        }
      
ImplementBrushSoftwareAuthorizationRespDto retData = new ImplementBrushSoftwareAuthorizationRespDto();
  
  

  
  
return retData;
  }
/**
   * D6查询软件授权证书列表[6553]
   * gen by moon at 5/18/2023, 4:43:32 PM
   */
  @Trace(operationName = "D6查询软件授权证书列表")
  @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Transactional(rollbackFor=Exception.class)
  @Override
  public QuerySoftwareAuthorizationListRespDto querySoftwareAuthorizationList(QuerySoftwareAuthorizationListReqDto reqDto){
    
      
      List<OmsSoftwareAuthorization> listOmsSoftwareAuthorization_1 =new ArrayList<>();
//步骤0: 6-1-01查询软件授权证书列表 - querySoftwareAuthorizationList
     List<OmsSoftwareAuthorization> listOmsSoftwareAuthorization =new ArrayList<>();
    QuerySoftwareAuthorizationListReq querySoftwareAuthorizationListReq=new QuerySoftwareAuthorizationListReq();
  if(reqDto!=null){
      querySoftwareAuthorizationListReq.setAuthorizationSpaceId(reqDto.getAuthorizationSpaceId());//SimpleFieldAssign//sourceId:927901_1
querySoftwareAuthorizationListReq.setIsArchive(reqDto.getIsArchive());//SimpleFieldAssign//sourceId:927902_1
    }
  
    /*6-1-01查询软件授权证书列表[6552]   */
    Assert.isNull(querySoftwareAuthorizationListReq.getAuthorizationSpaceId(),"D6查询软件授权证书列表-6-1-01查询软件授权证书列表-租户空间ID不能为空",false);
Assert.isNull(querySoftwareAuthorizationListReq.getIsArchive(),"D6查询软件授权证书列表-6-1-01查询软件授权证书列表-是否存档不能为空",false);
      listOmsSoftwareAuthorization = mOmsSoftwareAuthorizationService.querySoftwareAuthorizationList(querySoftwareAuthorizationListReq)/*vcase invoke 本地 method 方法调用;*/;
      
      
      listOmsSoftwareAuthorization_1 = listOmsSoftwareAuthorization;
    
QuerySoftwareAuthorizationListRespDto retData = new QuerySoftwareAuthorizationListRespDto();
  retData.setSoftwareAuthorizationList(listOmsSoftwareAuthorization_1.stream().map(item -> BeanUtil.toBean(item, SoftwareAuthorizationDto.class)).collect(Collectors.toList()));//objList-to-objLists//sourceId:935494_1
  

  
  
return retData;
  }
/**
   * D6新增软件授权证书(公共)[6609]
   * gen by moon at 5/28/2023, 12:47:46 AM
   */
  @Trace(operationName = "D6新增软件授权证书(公共)")
  @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Transactional(rollbackFor=Exception.class)
  @Override
  public AddSoftwareAuthorizationComRespDto addSoftwareAuthorizationCom(AddSoftwareAuthorizationComReqDto reqDto){
    
      
      QueryAcceptParametersDetailRespDto receptionServiceRes_1 =null;
if((reqDto!= null&&  reqDto.getSubjectLifeCycle() !=null && reqDto.getSubjectLifeCycle().equals("CURRENTLY_VALID"))) {
        //if(D6新增软件授权证书(公共).主体生命周期 等于 当前有效)  41334
        
QuerySchemeAuthInfoDetailComRespDto querySchemeAuthInfoDetailComRespDto = null;
    QuerySchemeAuthInfoDetailComReqDto querySchemeAuthInfoDetailComReqDto=new QuerySchemeAuthInfoDetailComReqDto();
  if(reqDto!=null){
      querySchemeAuthInfoDetailComReqDto.setSchOpenRecordId(reqDto.getSchOpenRecordId());//SimpleFieldAssign//sourceId:929687_1_41362
querySchemeAuthInfoDetailComReqDto.setTenantSpaceId(reqDto.getTenantSpaceId());//SimpleFieldAssign//sourceId:987956_1_41362
    }
  
    /*D2-3查开通记录详情(公共)[2507]   */
    Assert.isNull(querySchemeAuthInfoDetailComReqDto.getSchOpenRecordId(),"D6新增软件授权证书(公共)-D2-3查开通记录详情(公共)-开通钥匙ID不能为空",false);
      querySchemeAuthInfoDetailComRespDto = fwCompSchemeOpenRecordClient.querySchemeAuthInfoDetailCom(querySchemeAuthInfoDetailComReqDto).getData()/*vcase invoke 跨dubbo调用;*/;
      
      
      
if((querySchemeAuthInfoDetailComRespDto!= null&&  querySchemeAuthInfoDetailComRespDto.getApplexType() !=null && querySchemeAuthInfoDetailComRespDto.getApplexType().equals("TENANT_SPACE"))) {
        //if(D2-3查开通记录详情(公共).开通对象类型编码 等于 租户空间)  41338
        
if((querySchemeAuthInfoDetailComRespDto!= null&&  querySchemeAuthInfoDetailComRespDto.getIsMainConfScheme() !=null && querySchemeAuthInfoDetailComRespDto.getIsMainConfScheme().equals("TRUE"))) {
        //if(D2-3查开通记录详情(公共).是否主配置方案 等于 是)  41340
        
String string = null;
    if(querySchemeAuthInfoDetailComRespDto !=null){
          OmsSoftwareAuthorization omsSoftwareAuthorization=new OmsSoftwareAuthorization();
  omsSoftwareAuthorization.setIsDeploymentEnabled("FALSE");//sourceId:928846_1_41346
if(querySchemeAuthInfoDetailComRespDto!=null){
      omsSoftwareAuthorization.setAuthorizationName(querySchemeAuthInfoDetailComRespDto.getApplexName());//SimpleFieldAssign//sourceId:928834_1_41346
omsSoftwareAuthorization.setSchOpenRecordCode(querySchemeAuthInfoDetailComRespDto.getSchOpenRecordCode());//SimpleFieldAssign//sourceId:928836_1_41346
omsSoftwareAuthorization.setAuthorizationKeyTypeCode(querySchemeAuthInfoDetailComRespDto.getAuthorizationKeyTypeCode());//SimpleFieldAssign//sourceId:928837_1_41346
omsSoftwareAuthorization.setAuthorizationObjectId(querySchemeAuthInfoDetailComRespDto.getApplexId());//SimpleFieldAssign//sourceId:928838_1_41346
omsSoftwareAuthorization.setApplexName(querySchemeAuthInfoDetailComRespDto.getApplexName());//SimpleFieldAssign//sourceId:928839_1_41346
omsSoftwareAuthorization.setAuthorizationSpaceId(querySchemeAuthInfoDetailComRespDto.getTenantSpaceId());//SimpleFieldAssign//sourceId:928840_1_41346
omsSoftwareAuthorization.setSpaceShortName(querySchemeAuthInfoDetailComRespDto.getApplexName());//SimpleFieldAssign//sourceId:928841_1_41346
omsSoftwareAuthorization.setIsMainAuthorization(querySchemeAuthInfoDetailComRespDto.getIsMainConfScheme());//SimpleFieldAssign//sourceId:928845_1_41346
omsSoftwareAuthorization.setAuthorizationSchemeId(querySchemeAuthInfoDetailComRespDto.getConfSchemeId());//SimpleFieldAssign//sourceId:928847_1_41346
omsSoftwareAuthorization.setSchemeAuthorizationType(querySchemeAuthInfoDetailComRespDto.getAuthType());//SimpleFieldAssign//sourceId:928848_1_41346
omsSoftwareAuthorization.setAuthorizationNum(querySchemeAuthInfoDetailComRespDto.getRemainingQty()!=null?String.valueOf(querySchemeAuthInfoDetailComRespDto.getRemainingQty()):"");//SimpleFieldAssign//sourceId:928849_1_41346
omsSoftwareAuthorization.setAuthorizationStartTime(querySchemeAuthInfoDetailComRespDto.getStartTime());//SimpleFieldAssign//sourceId:928850_1_41346
omsSoftwareAuthorization.setAuthorizationEndTime(querySchemeAuthInfoDetailComRespDto.getEndTime());//SimpleFieldAssign//sourceId:928851_1_41346
omsSoftwareAuthorization.setAuthorizationUnit(querySchemeAuthInfoDetailComRespDto.getAuthUnit());//SimpleFieldAssign//sourceId:928852_1_41346
    }
if(reqDto!=null){
      omsSoftwareAuthorization.setSchOpenRecordId(reqDto.getSchOpenRecordId());//SimpleFieldAssign//sourceId:928835_1_41346
omsSoftwareAuthorization.setSubjectLifeCycle(reqDto.getSubjectLifeCycle());//SimpleFieldAssign//sourceId:928854_1_41346
    }
  
    /*6-1-01新增软件授权证书（有空间）[6607]   */
    Assert.isNull(omsSoftwareAuthorization.getAuthorizationName(),"D6新增软件授权证书(公共)-6-1-01新增软件授权证书（有空间）-授权证书名称不能为空",false);
Assert.isNull(omsSoftwareAuthorization.getSchOpenRecordId(),"D6新增软件授权证书(公共)-6-1-01新增软件授权证书（有空间）-开通钥匙ID不能为空",false);
Assert.isNull(omsSoftwareAuthorization.getSchOpenRecordCode(),"D6新增软件授权证书(公共)-6-1-01新增软件授权证书（有空间）-开通钥匙标识不能为空",false);
Assert.isNull(omsSoftwareAuthorization.getAuthorizationKeyTypeCode(),"D6新增软件授权证书(公共)-6-1-01新增软件授权证书（有空间）-开通钥匙类型标识不能为空",false);
Assert.isNull(omsSoftwareAuthorization.getAuthorizationObjectId(),"D6新增软件授权证书(公共)-6-1-01新增软件授权证书（有空间）-开通对象ID不能为空",false);
Assert.isNull(omsSoftwareAuthorization.getApplexName(),"D6新增软件授权证书(公共)-6-1-01新增软件授权证书（有空间）-冗余开通对象名称不能为空",false);
Assert.isNull(omsSoftwareAuthorization.getAuthorizationSpaceId(),"D6新增软件授权证书(公共)-6-1-01新增软件授权证书（有空间）-租户空间ID不能为空",false);
Assert.isNull(omsSoftwareAuthorization.getSpaceShortName(),"D6新增软件授权证书(公共)-6-1-01新增软件授权证书（有空间）-空间简称不能为空",false);
Assert.isNull(omsSoftwareAuthorization.getIsMainAuthorization(),"D6新增软件授权证书(公共)-6-1-01新增软件授权证书（有空间）-是否主证书不能为空",false);
Assert.isNull(omsSoftwareAuthorization.getIsDeploymentEnabled(),"D6新增软件授权证书(公共)-6-1-01新增软件授权证书（有空间）-是否已启用部署不能为空",false);
Assert.isNull(omsSoftwareAuthorization.getAuthorizationSchemeId(),"D6新增软件授权证书(公共)-6-1-01新增软件授权证书（有空间）-配置方案ID不能为空",false);
Assert.isNull(omsSoftwareAuthorization.getSchemeAuthorizationType(),"D6新增软件授权证书(公共)-6-1-01新增软件授权证书（有空间）-授权类型不能为空",false);
Assert.isNull(omsSoftwareAuthorization.getSubjectLifeCycle(),"D6新增软件授权证书(公共)-6-1-01新增软件授权证书（有空间）-主体生命周期不能为空",false);
      string = mOmsSoftwareAuthorizationService.addSoftwareAuthorization(omsSoftwareAuthorization)/*vcase invoke 本地 method 方法调用;*/;
      
      
      
           }
//ModelCode: receptionService
        QueryAcceptParametersDetailRespDto receptionServiceRes = null;
    if(string !=null){
          QueryAcceptParametersDetailReqDto receptionServiceReq=new QueryAcceptParametersDetailReqDto();
  if(string!=null){
      receptionServiceReq.setAuthorizationId(string);//SimpleFieldAssign//sourceId:944911_1_41781
    }
  
    /*M6查询接收参数(特殊方法)[6711]  用于特殊方法接收上游入参。 */
    Assert.isNull(receptionServiceReq.getAuthorizationId(),"D6新增软件授权证书(公共)-M6查询接收参数(特殊方法)-授权证书ID不能为空",false);
      receptionServiceRes = nbSecurity.queryAcceptParametersDetail(receptionServiceReq);
      
      
      receptionServiceRes_1 = receptionServiceRes;
           }
      }
else{
       //else  41345
      
String string_2 = null;
    if(querySchemeAuthInfoDetailComRespDto !=null){
          OmsSoftwareAuthorization omsSoftwareAuthorization_1=new OmsSoftwareAuthorization();
  omsSoftwareAuthorization_1.setIsDeploymentEnabled("FALSE");//sourceId:928184_1_41347
if(querySchemeAuthInfoDetailComRespDto!=null){
      omsSoftwareAuthorization_1.setAuthorizationName(querySchemeAuthInfoDetailComRespDto.getApplexName());//SimpleFieldAssign//sourceId:928172_1_41347
omsSoftwareAuthorization_1.setSchOpenRecordId(querySchemeAuthInfoDetailComRespDto.getSchOpenRecordId());//SimpleFieldAssign//sourceId:928173_1_41347
omsSoftwareAuthorization_1.setSchOpenRecordCode(querySchemeAuthInfoDetailComRespDto.getSchOpenRecordCode());//SimpleFieldAssign//sourceId:928174_1_41347
omsSoftwareAuthorization_1.setAuthorizationKeyTypeCode(querySchemeAuthInfoDetailComRespDto.getAuthorizationKeyTypeCode());//SimpleFieldAssign//sourceId:928175_1_41347
omsSoftwareAuthorization_1.setAuthorizationObjectId(querySchemeAuthInfoDetailComRespDto.getApplexId());//SimpleFieldAssign//sourceId:928176_1_41347
omsSoftwareAuthorization_1.setApplexName(querySchemeAuthInfoDetailComRespDto.getApplexName());//SimpleFieldAssign//sourceId:928177_1_41347
omsSoftwareAuthorization_1.setAuthorizationSpaceId(querySchemeAuthInfoDetailComRespDto.getTenantSpaceId());//SimpleFieldAssign//sourceId:928178_1_41347
omsSoftwareAuthorization_1.setIsMainAuthorization(querySchemeAuthInfoDetailComRespDto.getIsMainConfScheme());//SimpleFieldAssign//sourceId:928183_1_41347
omsSoftwareAuthorization_1.setAuthorizationSchemeId(querySchemeAuthInfoDetailComRespDto.getConfSchemeId());//SimpleFieldAssign//sourceId:928185_1_41347
omsSoftwareAuthorization_1.setSchemeAuthorizationType(querySchemeAuthInfoDetailComRespDto.getAuthType());//SimpleFieldAssign//sourceId:928186_1_41347
omsSoftwareAuthorization_1.setAuthorizationNum(querySchemeAuthInfoDetailComRespDto.getRemainingQty()!=null?String.valueOf(querySchemeAuthInfoDetailComRespDto.getRemainingQty()):"");//SimpleFieldAssign//sourceId:928187_1_41347
omsSoftwareAuthorization_1.setAuthorizationStartTime(querySchemeAuthInfoDetailComRespDto.getStartTime());//SimpleFieldAssign//sourceId:928188_1_41347
omsSoftwareAuthorization_1.setAuthorizationEndTime(querySchemeAuthInfoDetailComRespDto.getEndTime());//SimpleFieldAssign//sourceId:928189_1_41347
omsSoftwareAuthorization_1.setAuthorizationUnit(querySchemeAuthInfoDetailComRespDto.getAuthUnit());//SimpleFieldAssign//sourceId:928190_1_41347
    }
if(reqDto!=null){
      omsSoftwareAuthorization_1.setSubjectLifeCycle(reqDto.getSubjectLifeCycle());//SimpleFieldAssign//sourceId:928192_1_41347
    }
  
    /*6-1-01新增软件授权证书[6607]   */
    Assert.isNull(omsSoftwareAuthorization_1.getAuthorizationName(),"D6新增软件授权证书(公共)-6-1-01新增软件授权证书-授权证书名称不能为空",false);
Assert.isNull(omsSoftwareAuthorization_1.getSchOpenRecordId(),"D6新增软件授权证书(公共)-6-1-01新增软件授权证书-开通钥匙ID不能为空",false);
Assert.isNull(omsSoftwareAuthorization_1.getSchOpenRecordCode(),"D6新增软件授权证书(公共)-6-1-01新增软件授权证书-开通钥匙标识不能为空",false);
Assert.isNull(omsSoftwareAuthorization_1.getAuthorizationKeyTypeCode(),"D6新增软件授权证书(公共)-6-1-01新增软件授权证书-开通钥匙类型标识不能为空",false);
Assert.isNull(omsSoftwareAuthorization_1.getAuthorizationObjectId(),"D6新增软件授权证书(公共)-6-1-01新增软件授权证书-开通对象ID不能为空",false);
Assert.isNull(omsSoftwareAuthorization_1.getAuthorizationSpaceId(),"D6新增软件授权证书(公共)-6-1-01新增软件授权证书-租户空间ID不能为空",false);
Assert.isNull(omsSoftwareAuthorization_1.getIsMainAuthorization(),"D6新增软件授权证书(公共)-6-1-01新增软件授权证书-是否主证书不能为空",false);
Assert.isNull(omsSoftwareAuthorization_1.getIsDeploymentEnabled(),"D6新增软件授权证书(公共)-6-1-01新增软件授权证书-是否已启用部署不能为空",false);
Assert.isNull(omsSoftwareAuthorization_1.getAuthorizationSchemeId(),"D6新增软件授权证书(公共)-6-1-01新增软件授权证书-配置方案ID不能为空",false);
Assert.isNull(omsSoftwareAuthorization_1.getSchemeAuthorizationType(),"D6新增软件授权证书(公共)-6-1-01新增软件授权证书-授权类型不能为空",false);
Assert.isNull(omsSoftwareAuthorization_1.getSubjectLifeCycle(),"D6新增软件授权证书(公共)-6-1-01新增软件授权证书-主体生命周期不能为空",false);
      string_2 = mOmsSoftwareAuthorizationService.addSoftwareAuthorization(omsSoftwareAuthorization_1)/*vcase invoke 本地 method 方法调用;*/;
      
      
      
           }
//ModelCode: receptionService
        QueryAcceptParametersDetailRespDto receptionServiceRes_2 = null;
    if(string_2 !=null){
          QueryAcceptParametersDetailReqDto receptionServiceReq_1=new QueryAcceptParametersDetailReqDto();
  if(string_2!=null){
      receptionServiceReq_1.setAuthorizationId(string_2);//SimpleFieldAssign//sourceId:944911_1_41782
    }
  
    /*M6查询接收参数(特殊方法)[6711]  用于特殊方法接收上游入参。 */
    Assert.isNull(receptionServiceReq_1.getAuthorizationId(),"D6新增软件授权证书(公共)-M6查询接收参数(特殊方法)-授权证书ID不能为空",false);
      receptionServiceRes_2 = nbSecurity.queryAcceptParametersDetail(receptionServiceReq_1);
      
      
      receptionServiceRes_1 = receptionServiceRes_2;
           }
    }
      }
else if((querySchemeAuthInfoDetailComRespDto!= null&&  querySchemeAuthInfoDetailComRespDto.getApplexType() !=null && querySchemeAuthInfoDetailComRespDto.getApplexType().equals("EVA_THEME"))){
       //elseif(D2-3查开通记录详情(公共).开通对象类型编码 等于 评价主题)  41341
      
String string_4 = null;
    if(querySchemeAuthInfoDetailComRespDto !=null){
          OmsSoftwareAuthorization omsSoftwareAuthorization_2=new OmsSoftwareAuthorization();
  omsSoftwareAuthorization_2.setIsDeploymentEnabled("FALSE");//sourceId:928184_1_41348
if(querySchemeAuthInfoDetailComRespDto!=null){
      omsSoftwareAuthorization_2.setAuthorizationName(querySchemeAuthInfoDetailComRespDto.getApplexName());//SimpleFieldAssign//sourceId:928172_1_41348
omsSoftwareAuthorization_2.setSchOpenRecordId(querySchemeAuthInfoDetailComRespDto.getSchOpenRecordId());//SimpleFieldAssign//sourceId:928173_1_41348
omsSoftwareAuthorization_2.setSchOpenRecordCode(querySchemeAuthInfoDetailComRespDto.getSchOpenRecordCode());//SimpleFieldAssign//sourceId:928174_1_41348
omsSoftwareAuthorization_2.setAuthorizationKeyTypeCode(querySchemeAuthInfoDetailComRespDto.getAuthorizationKeyTypeCode());//SimpleFieldAssign//sourceId:928175_1_41348
omsSoftwareAuthorization_2.setAuthorizationObjectId(querySchemeAuthInfoDetailComRespDto.getApplexId());//SimpleFieldAssign//sourceId:928176_1_41348
omsSoftwareAuthorization_2.setApplexName(querySchemeAuthInfoDetailComRespDto.getApplexName());//SimpleFieldAssign//sourceId:928177_1_41348
omsSoftwareAuthorization_2.setAuthorizationSpaceId(querySchemeAuthInfoDetailComRespDto.getTenantSpaceId());//SimpleFieldAssign//sourceId:928178_1_41348
omsSoftwareAuthorization_2.setIsMainAuthorization(querySchemeAuthInfoDetailComRespDto.getIsMainConfScheme());//SimpleFieldAssign//sourceId:928183_1_41348
omsSoftwareAuthorization_2.setAuthorizationSchemeId(querySchemeAuthInfoDetailComRespDto.getConfSchemeId());//SimpleFieldAssign//sourceId:928185_1_41348
omsSoftwareAuthorization_2.setSchemeAuthorizationType(querySchemeAuthInfoDetailComRespDto.getAuthType());//SimpleFieldAssign//sourceId:928186_1_41348
omsSoftwareAuthorization_2.setAuthorizationNum(querySchemeAuthInfoDetailComRespDto.getRemainingQty()!=null?String.valueOf(querySchemeAuthInfoDetailComRespDto.getRemainingQty()):"");//SimpleFieldAssign//sourceId:928187_1_41348
omsSoftwareAuthorization_2.setAuthorizationStartTime(querySchemeAuthInfoDetailComRespDto.getStartTime());//SimpleFieldAssign//sourceId:928188_1_41348
omsSoftwareAuthorization_2.setAuthorizationEndTime(querySchemeAuthInfoDetailComRespDto.getEndTime());//SimpleFieldAssign//sourceId:928189_1_41348
omsSoftwareAuthorization_2.setAuthorizationUnit(querySchemeAuthInfoDetailComRespDto.getAuthUnit());//SimpleFieldAssign//sourceId:928190_1_41348
    }
if(reqDto!=null){
      omsSoftwareAuthorization_2.setSubjectLifeCycle(reqDto.getSubjectLifeCycle());//SimpleFieldAssign//sourceId:928192_1_41348
    }
  
    /*6-1-01新增软件授权证书[6607]   */
    Assert.isNull(omsSoftwareAuthorization_2.getAuthorizationName(),"D6新增软件授权证书(公共)-6-1-01新增软件授权证书-授权证书名称不能为空",false);
Assert.isNull(omsSoftwareAuthorization_2.getSchOpenRecordId(),"D6新增软件授权证书(公共)-6-1-01新增软件授权证书-开通钥匙ID不能为空",false);
Assert.isNull(omsSoftwareAuthorization_2.getSchOpenRecordCode(),"D6新增软件授权证书(公共)-6-1-01新增软件授权证书-开通钥匙标识不能为空",false);
Assert.isNull(omsSoftwareAuthorization_2.getAuthorizationKeyTypeCode(),"D6新增软件授权证书(公共)-6-1-01新增软件授权证书-开通钥匙类型标识不能为空",false);
Assert.isNull(omsSoftwareAuthorization_2.getAuthorizationObjectId(),"D6新增软件授权证书(公共)-6-1-01新增软件授权证书-开通对象ID不能为空",false);
Assert.isNull(omsSoftwareAuthorization_2.getAuthorizationSpaceId(),"D6新增软件授权证书(公共)-6-1-01新增软件授权证书-租户空间ID不能为空",false);
Assert.isNull(omsSoftwareAuthorization_2.getIsMainAuthorization(),"D6新增软件授权证书(公共)-6-1-01新增软件授权证书-是否主证书不能为空",false);
Assert.isNull(omsSoftwareAuthorization_2.getIsDeploymentEnabled(),"D6新增软件授权证书(公共)-6-1-01新增软件授权证书-是否已启用部署不能为空",false);
Assert.isNull(omsSoftwareAuthorization_2.getAuthorizationSchemeId(),"D6新增软件授权证书(公共)-6-1-01新增软件授权证书-配置方案ID不能为空",false);
Assert.isNull(omsSoftwareAuthorization_2.getSchemeAuthorizationType(),"D6新增软件授权证书(公共)-6-1-01新增软件授权证书-授权类型不能为空",false);
Assert.isNull(omsSoftwareAuthorization_2.getSubjectLifeCycle(),"D6新增软件授权证书(公共)-6-1-01新增软件授权证书-主体生命周期不能为空",false);
      string_4 = mOmsSoftwareAuthorizationService.addSoftwareAuthorization(omsSoftwareAuthorization_2)/*vcase invoke 本地 method 方法调用;*/;
      
      
      
           }
//ModelCode: receptionService
        QueryAcceptParametersDetailRespDto receptionServiceRes_3 = null;
    if(string_4 !=null){
          QueryAcceptParametersDetailReqDto receptionServiceReq_2=new QueryAcceptParametersDetailReqDto();
  if(string_4!=null){
      receptionServiceReq_2.setAuthorizationId(string_4);//SimpleFieldAssign//sourceId:944911_1_41783
    }
  
    /*M6查询接收参数(特殊方法)[6711]  用于特殊方法接收上游入参。 */
    Assert.isNull(receptionServiceReq_2.getAuthorizationId(),"D6新增软件授权证书(公共)-M6查询接收参数(特殊方法)-授权证书ID不能为空",false);
      receptionServiceRes_3 = nbSecurity.queryAcceptParametersDetail(receptionServiceReq_2);
      
      
      receptionServiceRes_1 = receptionServiceRes_3;
           }
    }
      }
AddSoftwareAuthorizationComRespDto retData = new AddSoftwareAuthorizationComRespDto();
  if(receptionServiceRes_1!=null){
      retData.setAuthorizationId(receptionServiceRes_1.getAuthorizationId());//SimpleFieldAssign//sourceId:944916_1
    }
  

  
  
return retData;
  }
/**
   * D6查询软件授权证书详情[6610]
   * gen by moon at 5/18/2023, 4:43:36 PM
   */
  @Trace(operationName = "D6查询软件授权证书详情")
  @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Transactional(rollbackFor=Exception.class)
  @Override
  public QuerySoftwareAuthorizationDetailRespDto querySoftwareAuthorizationDetail(QuerySoftwareAuthorizationDetailReqDto reqDto){
    
      
      OmsSoftwareAuthorization omsSoftwareAuthorization_1 =null;
//步骤0: 6-1-01查询软件授权证书详情 - querySoftwareAuthorizationDetail
     OmsSoftwareAuthorization omsSoftwareAuthorization = null;
    QuerySoftwareAuthorizationDetailReq querySoftwareAuthorizationDetailReq=new QuerySoftwareAuthorizationDetailReq();
  if(reqDto!=null){
      querySoftwareAuthorizationDetailReq.setAuthorizationId(reqDto.getAuthorizationId());//SimpleFieldAssign//sourceId:928512_1
    }
  
    /*6-1-01查询软件授权证书详情[6605]   */
    
      omsSoftwareAuthorization = mOmsSoftwareAuthorizationService.querySoftwareAuthorizationDetail(querySoftwareAuthorizationDetailReq)/*vcase invoke 本地 method 方法调用;*/;
      
      
      omsSoftwareAuthorization_1 = omsSoftwareAuthorization;
    
QuerySoftwareAuthorizationDetailRespDto retData = new QuerySoftwareAuthorizationDetailRespDto();
  if(omsSoftwareAuthorization_1!=null){
      retData.setAuthorizationId(omsSoftwareAuthorization_1.getAuthorizationId());//SimpleFieldAssign//sourceId:928553_1
retData.setAuthorizationName(omsSoftwareAuthorization_1.getAuthorizationName());//SimpleFieldAssign//sourceId:928554_1
retData.setSchOpenRecordId(omsSoftwareAuthorization_1.getSchOpenRecordId());//SimpleFieldAssign//sourceId:928555_1
retData.setSchOpenRecordCode(omsSoftwareAuthorization_1.getSchOpenRecordCode());//SimpleFieldAssign//sourceId:928556_1
retData.setApplObjType(omsSoftwareAuthorization_1.getApplObjType());//SimpleFieldAssign//sourceId:931060_1
retData.setAuthorizationKeyTypeCode(omsSoftwareAuthorization_1.getAuthorizationKeyTypeCode());//SimpleFieldAssign//sourceId:932205_1
retData.setAuthorizationObjectId(omsSoftwareAuthorization_1.getAuthorizationObjectId());//SimpleFieldAssign//sourceId:928558_1
retData.setApplexName(omsSoftwareAuthorization_1.getApplexName());//SimpleFieldAssign//sourceId:928559_1
retData.setAuthorizationSpaceId(omsSoftwareAuthorization_1.getAuthorizationSpaceId());//SimpleFieldAssign//sourceId:928560_1
retData.setSpaceShortName(omsSoftwareAuthorization_1.getSpaceShortName());//SimpleFieldAssign//sourceId:928561_1
retData.setDnsAddresses(omsSoftwareAuthorization_1.getDnsAddresses());//SimpleFieldAssign//sourceId:928562_1
retData.setIpAddresses(omsSoftwareAuthorization_1.getIpAddresses());//SimpleFieldAssign//sourceId:928563_1
retData.setServerMacCode(omsSoftwareAuthorization_1.getServerMacCode());//SimpleFieldAssign//sourceId:928564_1
retData.setIsMainAuthorization(omsSoftwareAuthorization_1.getIsMainAuthorization());//SimpleFieldAssign//sourceId:928565_1
retData.setIsDeploymentEnabled(omsSoftwareAuthorization_1.getIsDeploymentEnabled());//SimpleFieldAssign//sourceId:928566_1
retData.setAuthorizationSchemeId(omsSoftwareAuthorization_1.getAuthorizationSchemeId());//SimpleFieldAssign//sourceId:928567_1
retData.setSchemeAuthorizationType(omsSoftwareAuthorization_1.getSchemeAuthorizationType());//SimpleFieldAssign//sourceId:928568_1
retData.setAuthorizationNum(omsSoftwareAuthorization_1.getAuthorizationNum());//SimpleFieldAssign//sourceId:928569_1
retData.setAuthorizationStartTime(omsSoftwareAuthorization_1.getAuthorizationStartTime());//SimpleFieldAssign//sourceId:928570_1
retData.setAuthorizationEndTime(omsSoftwareAuthorization_1.getAuthorizationEndTime());//SimpleFieldAssign//sourceId:928571_1
retData.setAuthorizationUnit(omsSoftwareAuthorization_1.getAuthorizationUnit());//SimpleFieldAssign//sourceId:928572_1
retData.setDeployTypeCode(omsSoftwareAuthorization_1.getDeployTypeCode());//SimpleFieldAssign//sourceId:928573_1
retData.setSubjectLifeCycle(omsSoftwareAuthorization_1.getSubjectLifeCycle());//SimpleFieldAssign//sourceId:928574_1
retData.setOperationInductionId(omsSoftwareAuthorization_1.getOperationInductionId());//SimpleFieldAssign//sourceId:928575_1
retData.setOperateTime(omsSoftwareAuthorization_1.getOperateTime());//SimpleFieldAssign//sourceId:928579_1
    }
  

  
  
return retData;
  }
/**
   * D6修改软件授权证书[6613]
   * gen by moon at 5/25/2023, 11:21:02 PM
   */
  @Trace(operationName = "D6修改软件授权证书")
  @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Transactional(rollbackFor=Exception.class)
  @Override
  public UpdateSoftwareAuthorizationRespDto updateSoftwareAuthorization(UpdateSoftwareAuthorizationReqDto reqDto){
    
      
      //步骤0: 6-1-01修改软件授权证书 - updateSoftwareAuthorization
      boolean bOOLEAN ;
    OmsSoftwareAuthorization omsSoftwareAuthorization=new OmsSoftwareAuthorization();
  if(reqDto!=null){
      omsSoftwareAuthorization.setAuthorizationId(reqDto.getAuthorizationId());//SimpleFieldAssign//sourceId:928807_1
omsSoftwareAuthorization.setAuthorizationName(reqDto.getAuthorizationName());//SimpleFieldAssign//sourceId:928808_1
omsSoftwareAuthorization.setDnsAddresses(reqDto.getDnsAddresses());//SimpleFieldAssign//sourceId:931066_1
omsSoftwareAuthorization.setIpAddresses(reqDto.getIpAddresses());//SimpleFieldAssign//sourceId:931067_1
omsSoftwareAuthorization.setServerMacCode(reqDto.getServerMacCode());//SimpleFieldAssign//sourceId:931068_1
omsSoftwareAuthorization.setIsDeploymentEnabled(reqDto.getIsDeploymentEnabled());//SimpleFieldAssign//sourceId:928809_1
omsSoftwareAuthorization.setDeployTypeCode(reqDto.getDeployTypeCode());//SimpleFieldAssign//sourceId:928810_1
    }
  
    /*6-1-01修改软件授权证书[6612]   */
    Assert.isNull(omsSoftwareAuthorization.getAuthorizationId(),"D6修改软件授权证书-6-1-01修改软件授权证书-授权证书ID不能为空",false);
      bOOLEAN = mOmsSoftwareAuthorizationService.updateSoftwareAuthorization(omsSoftwareAuthorization)/*vcase invoke 本地 method 方法调用;*/;
      
      


UpdateSoftwareAuthorizationRespDto retData = new UpdateSoftwareAuthorizationRespDto();
  
  

  
  
return retData;
  }
/**
   * D6删除软件授权证书[6616]
   * gen by moon at 5/18/2023, 4:43:40 PM
   */
  @Trace(operationName = "D6删除软件授权证书")
  @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Transactional(rollbackFor=Exception.class)
  @Override
  public DeleteSoftwareAuthorizationRespDto deleteSoftwareAuthorization(DeleteSoftwareAuthorizationReqDto reqDto){
    
      
      //virtualUsage 6-1-01查询软件授权证书详情  41292
      OmsSoftwareAuthorization omsSoftwareAuthorization = null;
    QuerySoftwareAuthorizationDetailReq querySoftwareAuthorizationDetailReq=new QuerySoftwareAuthorizationDetailReq();
  if(reqDto!=null){
      querySoftwareAuthorizationDetailReq.setAuthorizationId(reqDto.getAuthorizationId());//SimpleFieldAssign//sourceId:928923_1_41292
    }
  
    /*6-1-01查询软件授权证书详情[6605]   */
    
      omsSoftwareAuthorization = mOmsSoftwareAuthorizationService.querySoftwareAuthorizationDetail(querySoftwareAuthorizationDetailReq)/*vcase invoke 本地 method 方法调用;*/;
      Assert.isTrue(omsSoftwareAuthorization== null||  omsSoftwareAuthorization.getSubjectLifeCycle() ==null,"找不到数据，系统异常",false);
      
      
if((omsSoftwareAuthorization!= null&&  omsSoftwareAuthorization.getSubjectLifeCycle() !=null && omsSoftwareAuthorization.getSubjectLifeCycle().equals("EDITING"))) {
        //if(1-04-01查询软件授权证书详情.主体生命周期 等于 正在编辑)  41293
        
boolean bOOLEAN ;
    String string=new String();
  if(reqDto!=null){
      string=reqDto.getAuthorizationId();;//SimpleFieldAssign//sourceId:928911_1_41294
    }
  
    /*6-1-01删除软件授权证书[6615]   */
    Assert.isNull(string,"D6删除软件授权证书-6-1-01删除软件授权证书-授权证书ID不能为空",false);
      bOOLEAN = mOmsSoftwareAuthorizationService.deleteSoftwareAuthorization(string)/*vcase invoke 本地 method 方法调用;*/;
      
      
      
      }
DeleteSoftwareAuthorizationRespDto retData = new DeleteSoftwareAuthorizationRespDto();
  
  

  
  
return retData;
  }
/**
   * D6存档软件授权证书[6618]
   * gen by moon at 5/18/2023, 4:43:41 PM
   */
  @Trace(operationName = "D6存档软件授权证书")
  @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Transactional(rollbackFor=Exception.class)
  @Override
  public ArchiveSoftwareAuthorizationRespDto archiveSoftwareAuthorization(ArchiveSoftwareAuthorizationReqDto reqDto){
    
      
      //virtualUsage 6-1-01查询软件授权证书详情  41320
      OmsSoftwareAuthorization omsSoftwareAuthorization = null;
    QuerySoftwareAuthorizationDetailReq querySoftwareAuthorizationDetailReq=new QuerySoftwareAuthorizationDetailReq();
  if(reqDto!=null){
      querySoftwareAuthorizationDetailReq.setAuthorizationId(reqDto.getAuthorizationId());//SimpleFieldAssign//sourceId:929055_1_41320
    }
  
    /*6-1-01查询软件授权证书详情[6605]   */
    
      omsSoftwareAuthorization = mOmsSoftwareAuthorizationService.querySoftwareAuthorizationDetail(querySoftwareAuthorizationDetailReq)/*vcase invoke 本地 method 方法调用;*/;
      
      
      
if((omsSoftwareAuthorization!= null&&  omsSoftwareAuthorization.getSubjectLifeCycle() !=null && omsSoftwareAuthorization.getSubjectLifeCycle().equals("CURRENTLY_VALID"))) {
        //if(1-04-01查询软件授权证书详情.主体生命周期 等于 当前有效)  41322
        
boolean bOOLEAN ;
    OmsSoftwareAuthorization omsSoftwareAuthorization_2=new OmsSoftwareAuthorization();
  omsSoftwareAuthorization_2.setSubjectLifeCycle("ARCHIVING");//sourceId:929107_1_41323
omsSoftwareAuthorization_2.setIsArchive("TRUE");//sourceId:948117_1_41323
  
    /*6-1-01修改软件授权证书[6612]   */
    Assert.isNull(omsSoftwareAuthorization_2.getAuthorizationId(),"D6存档软件授权证书-6-1-01修改软件授权证书-授权证书ID不能为空",false);
Assert.isNull(omsSoftwareAuthorization_2.getSubjectLifeCycle(),"D6存档软件授权证书-6-1-01修改软件授权证书-主体生命周期不能为空",false);
      bOOLEAN = mOmsSoftwareAuthorizationService.updateSoftwareAuthorization(omsSoftwareAuthorization_2)/*vcase invoke 本地 method 方法调用;*/;
      
      
      
      }
ArchiveSoftwareAuthorizationRespDto retData = new ArchiveSoftwareAuthorizationRespDto();
  
  

  
  
return retData;
  }
/**
   * D6生成License(公共)[6643]
   * gen by moon at 5/25/2023, 11:20:56 PM
   */
  @Trace(operationName = "D6生成License(公共)")
  @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Transactional(rollbackFor=Exception.class)
  @Override
  public AddGenerateLicenseComRespDto addGenerateLicenseCom(AddGenerateLicenseComReqDto reqDto){
    
      
      AddGenerateLicenseRespDto generateLicenseRes_1 =null;
//步骤0: 6-1-01查询软件授权证书列表 - querySoftwareAuthorizationList
     List<OmsSoftwareAuthorization> listOmsSoftwareAuthorization =new ArrayList<>();
    QuerySoftwareAuthorizationListReq querySoftwareAuthorizationListReq=new QuerySoftwareAuthorizationListReq();
  querySoftwareAuthorizationListReq.setIsArchive("FALSE");//sourceId:936430_1
if(reqDto!=null){
      querySoftwareAuthorizationListReq.setAuthorizationSpaceId(reqDto.getAuthorizationSpaceId());//SimpleFieldAssign//sourceId:936429_1
    }
  
    /*6-1-01查软件授权证书列表[6552]   */
    Assert.isNull(querySoftwareAuthorizationListReq.getAuthorizationSpaceId(),"D6生成License(公共)-6-1-01查软件授权证书列表-租户空间ID不能为空",false);
Assert.isNull(querySoftwareAuthorizationListReq.getIsArchive(),"D6生成License(公共)-6-1-01查软件授权证书列表-是否存档不能为空",false);
      listOmsSoftwareAuthorization = mOmsSoftwareAuthorizationService.querySoftwareAuthorizationList(querySoftwareAuthorizationListReq)/*vcase invoke 本地 method 方法调用;*/;
      
      
      
    
//步骤1: 6-1-01批量改软件授权证书 - batchUpdateSoftwareAuthorization
     boolean bOOLEAN ;
    if(listOmsSoftwareAuthorization !=null&& !CollectionUtil.isEmpty(listOmsSoftwareAuthorization)&& listOmsSoftwareAuthorization.size()>0 ){
          List<OmsSoftwareAuthorization> listOmsSoftwareAuthorization_2=new ArrayList<>();
  if(listOmsSoftwareAuthorization!= null&& !CollectionUtil.isEmpty(listOmsSoftwareAuthorization)&&  listOmsSoftwareAuthorization !=null&& !CollectionUtil.isEmpty(listOmsSoftwareAuthorization)){
      listOmsSoftwareAuthorization_2 = listOmsSoftwareAuthorization.stream().map(item -> {
        OmsSoftwareAuthorization elm =BeanUtil.toBean(item, OmsSoftwareAuthorization.class);
        elm.setIsDeploymentEnabled("TRUE");

        return elm;
      }).collect(Collectors.toList());//objList-to-objLists//sourceId:984670_1
    }

    /*6-1-01批量改软件授权证书[6946]   */

      bOOLEAN = mOmsSoftwareAuthorizationService.batchUpdateSoftwareAuthorization(listOmsSoftwareAuthorization_2)/*vcase invoke 本地 method 方法调用;*/;



           }

//步骤2: M6新增生成License（特殊方法） - addGenerateLicense
     //ModelCode: generateLicense
        AddGenerateLicenseRespDto generateLicenseRes = null;
    if(listOmsSoftwareAuthorization !=null&& !CollectionUtil.isEmpty(listOmsSoftwareAuthorization)&& listOmsSoftwareAuthorization.size()>0 ){
          AddGenerateLicenseReqDto generateLicenseReq=new AddGenerateLicenseReqDto();
  if(listOmsSoftwareAuthorization!= null&& !CollectionUtil.isEmpty(listOmsSoftwareAuthorization)&&  listOmsSoftwareAuthorization !=null&& !CollectionUtil.isEmpty(listOmsSoftwareAuthorization)){
      generateLicenseReq.setSoftwareAuthorizationList(listOmsSoftwareAuthorization.stream().map(item -> {
        SoftwareAuthorizationDto elm =BeanUtil.toBean(item, SoftwareAuthorizationDto.class);
        elm.setIsDeploymentEnabled("TRUE");

        return elm;
      }).collect(Collectors.toList()));//objList-to-objLists//sourceId:936428_1
    }

    /*M6新增生成License（特殊方法）[6642]   */

      generateLicenseRes = nbSecurity.addGenerateLicense(generateLicenseReq);


      generateLicenseRes_1 = generateLicenseRes;
           }

AddGenerateLicenseComRespDto retData = new AddGenerateLicenseComRespDto();
  if(generateLicenseRes_1!=null){
      retData.setCodeHeaderText(generateLicenseRes_1.getCodeHeaderText());//SimpleFieldAssign//sourceId:935748_1
retData.setCodeImplementText(generateLicenseRes_1.getCodeImplementText());//SimpleFieldAssign//sourceId:935749_1
    }
  

  
  
return retData;
  }
/**
   * D6查询安全License详情[6685]
   * gen by moon at 5/18/2023, 4:43:46 PM
   */
  @Trace(operationName = "D6查询安全License详情")
  @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Transactional(rollbackFor=Exception.class)
  @Override
  public QuerySecurityLicenseDetailRespDto querySecurityLicenseDetail(QuerySecurityLicenseDetailReqDto reqDto){
    
      
      QueryOperateObtainSecurityParamDataDetailRespDto obtainSecureParamRes_1 =null;
//步骤0: M6查询运营获取安全参数数据（特殊方法） - queryOperateObtainSecurityParamDataDetail
     //ModelCode: obtainSecureParam
        QueryOperateObtainSecurityParamDataDetailRespDto obtainSecureParamRes = null;
    QueryOperateObtainSecurityParamDataDetailReqDto obtainSecureParamReq=new QueryOperateObtainSecurityParamDataDetailReqDto();
  if(reqDto!=null){
      obtainSecureParamReq.setAuthorizationKeyTypeCode(reqDto.getAuthorizationKeyTypeCode());//SimpleFieldAssign//sourceId:944608_1
    }
  
    /*M6查询运营获取安全参数数据（特殊方法）[6710]  用于获取license内部安全参数数据 */
    Assert.isNull(obtainSecureParamReq.getAuthorizationKeyTypeCode(),"D6查询安全License详情-M6查询运营获取安全参数数据（特殊方法）-开通钥匙类型标识不能为空",false);
      obtainSecureParamRes = nbSecurity.queryOperateObtainSecurityParamDataDetail(obtainSecureParamReq);
      
      
      obtainSecureParamRes_1 = obtainSecureParamRes;
    
QuerySecurityLicenseDetailRespDto retData = new QuerySecurityLicenseDetailRespDto();
  if(obtainSecureParamRes_1!=null){
      retData.setSchOpenRecordId(obtainSecureParamRes_1.getSchOpenRecordId());//SimpleFieldAssign//sourceId:944617_1
retData.setSchOpenRecordCode(obtainSecureParamRes_1.getSchOpenRecordCode());//SimpleFieldAssign//sourceId:944618_1
retData.setDeployTypeCode(obtainSecureParamRes_1.getDeployTypeCode());//SimpleFieldAssign//sourceId:944619_1
retData.setSchemeAuthorizationType(obtainSecureParamRes_1.getSchemeAuthorizationType());//SimpleFieldAssign//sourceId:944620_1
retData.setAuthorizationNum(obtainSecureParamRes_1.getAuthorizationNum());//SimpleFieldAssign//sourceId:944621_1
retData.setAuthorizationStartTime(obtainSecureParamRes_1.getAuthorizationStartTime());//SimpleFieldAssign//sourceId:944622_1
retData.setAuthorizationEndTime(obtainSecureParamRes_1.getAuthorizationEndTime());//SimpleFieldAssign//sourceId:944623_1
    }
  

  
  
return retData;
  }
/**
   * D6查询安全License详情(公共)[6685]
   * gen by moon at 5/26/2023, 8:16:45 PM
   */
  @Trace(operationName = "D6查询安全License详情(公共)")
  @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Transactional(rollbackFor=Exception.class)
  @Override
  public QuerySecurityLicenseDetailComRespDto querySecurityLicenseDetailCom(QuerySecurityLicenseDetailComReqDto reqDto){


      QueryOperateObtainSecurityParamDataDetailRespDto obtainSecureParamRes_1 =null;
//步骤0: M6查询运营获取安全参数数据（特殊方法） - queryOperateObtainSecurityParamDataDetail
     //ModelCode: obtainSecureParam
        QueryOperateObtainSecurityParamDataDetailRespDto obtainSecureParamRes = null;
    QueryOperateObtainSecurityParamDataDetailReqDto obtainSecureParamReq=new QueryOperateObtainSecurityParamDataDetailReqDto();
  if(reqDto!=null){
      obtainSecureParamReq.setAuthorizationKeyTypeCode(reqDto.getAuthorizationKeyTypeCode());//SimpleFieldAssign//sourceId:944608_1
    }

    /*M6查询运营获取安全参数数据（特殊方法）[6710]  用于获取license内部安全参数数据 */
    Assert.isNull(obtainSecureParamReq.getAuthorizationKeyTypeCode(),"D6查询安全License详情(公共)-M6查询运营获取安全参数数据（特殊方法）-开通钥匙类型标识不能为空",false);
      obtainSecureParamRes = nbSecurity.queryOperateObtainSecurityParamDataDetail(obtainSecureParamReq);


      obtainSecureParamRes_1 = obtainSecureParamRes;

QuerySecurityLicenseDetailComRespDto retData = new QuerySecurityLicenseDetailComRespDto();
  if(obtainSecureParamRes_1!=null){
      retData.setSchOpenRecordId(obtainSecureParamRes_1.getSchOpenRecordId());//SimpleFieldAssign//sourceId:944617_1
retData.setSchOpenRecordCode(obtainSecureParamRes_1.getSchOpenRecordCode());//SimpleFieldAssign//sourceId:944618_1
retData.setDeployTypeCode(obtainSecureParamRes_1.getDeployTypeCode());//SimpleFieldAssign//sourceId:944619_1
retData.setSchemeAuthorizationType(obtainSecureParamRes_1.getSchemeAuthorizationType());//SimpleFieldAssign//sourceId:944620_1
retData.setAuthorizationNum(obtainSecureParamRes_1.getAuthorizationNum());//SimpleFieldAssign//sourceId:944621_1
retData.setAuthorizationUnit(obtainSecureParamRes_1.getAuthorizationUnit());//SimpleFieldAssign//sourceId:1913065_1
retData.setAuthorizationStartTime(obtainSecureParamRes_1.getAuthorizationStartTime());//SimpleFieldAssign//sourceId:944622_1
retData.setAuthorizationEndTime(obtainSecureParamRes_1.getAuthorizationEndTime());//SimpleFieldAssign//sourceId:944623_1
    }




return retData;
  }
  //
}
